//
//  HYCPushDiscountCell.m
//  FamilyTravel
//
//  Created by dllo on 15/10/23.
//  Copyright (c) 2015年 蓝鸥科技. All rights reserved.
//

#import "HYCPushDiscountCell.h"
#import "HYCPushDiscountModel.h"
#import <UIImageView+WebCache.h>
#define WIDTH self.contentView.frame.size.width
#define HEIFGT self.contentView.frame.size.height
@implementation HYCPushDiscountCell



- (void)dealloc {
    [_disLabel release];
    [_moneyLabel release];
    [_headImageView release];
    [_textLabel release];
    [_timeLabel release];

    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        
        
        self.headImageView = [[UIImageView alloc] initWithFrame:CGRectMake(5, 5, WIDTH / 1.1142, HEIFGT / 1.7645)];
        [self.contentView addSubview:self.headImageView];
//        self.headImageView.backgroundColor = [UIColor redColor];
        [_headImageView release];
        
        self.disLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, HEIFGT / 1.65, WIDTH / 3.75, 10)];
        [self.contentView addSubview:self.disLabel];
        self.disLabel.textColor = [UIColor redColor];
        self.disLabel.font = [UIFont systemFontOfSize:12];
        [_disLabel release];
        
        self.moneyLabel= [[UILabel alloc] initWithFrame:CGRectMake(WIDTH / 1.6666, HEIFGT / 1.65, WIDTH / 2.5, 15)];
        [self.contentView addSubview:self.moneyLabel];
        self.moneyLabel.font = [UIFont systemFontOfSize:12];
        self.moneyLabel.textColor = [UIColor redColor];
        [_moneyLabel release];
        
        self.textLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, HEIFGT / 1.5, WIDTH / 1.121, HEIFGT / 4.11666)];
        [self.contentView addSubview:self.textLabel];
        self.textLabel.font = [UIFont systemFontOfSize:15];
        self.textLabel.numberOfLines = 0;
//        self.textLabel.backgroundColor = [UIColor redColor];
        [_textLabel release];
        
        self.timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, HEIFGT / 1.1, WIDTH / 1.5, HEIFGT / 12.35)];
        self.timeLabel.font = [UIFont systemFontOfSize:12];
        [self.contentView addSubview:self.timeLabel];
//        self.timeLabel.backgroundColor = [UIColor whiteColor];
        [_timeLabel release];
        
    }
    return self;
}

- (void)setModel:(HYCPushDiscountModel *)model {
    
    if (self.model != model) {
        [_model release];
        _model = [model retain];

        _disLabel.text = _model.lastminute_des;
        [_headImageView sd_setImageWithURL:[NSURL URLWithString:_model.pic]placeholderImage:[UIImage imageNamed:@"zw.png"]];
        _textLabel.text = _model.title;
        _timeLabel.text = _model.departureTime;
        NSString *str = [_model.buy_price stringByAppendingString:@"元起"];
        
        _moneyLabel.text = str;
        

    }

}


@end
